using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;

namespace MallApi.DTOs.Requests;

/// <summary>
/// 用户登录请求模型
/// </summary>
public class LoginRequest
{
  /// <summary>
  /// 手机号码
  /// </summary>
  [Required(ErrorMessage = "手机号码不能为空")]
  [RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "请输入有效的手机号码")]
  public string Mobile { get; set; } = string.Empty;

  /// <summary>
  /// 验证码
  /// </summary>
  [Required(ErrorMessage = "验证码不能为空")]
  [RegularExpression(@"^\d{6}$", ErrorMessage = "验证码必须是6位数字")]
  public string Code { get; set; } = string.Empty;
}